import { createRouter, createWebHistory } from "vue-router";

const Layout = () => import(/* webpackChunkName: "home" */ "@/views/HomeView");

const routes = [
  {
    path: "/",
    name: "home",
    component: Layout,
    redirect: "/products/selection",
    children: [
      {
        path: "/products/selection",
        name: "selection",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/selection"),
        meta: {
          title: "选品中心"
        }
      },
      {
        path: "/products/pre-selection",
        name: "pre-selection",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/selection/preSelection"),
        meta: {
          title: "预选商品"
        }
      },
      {
        path: "/products/manage",
        name: "manage",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/manage"),
        meta: {
          title: "商品管理"
        }
      },
      {
        path: "/products/manage/add",
        name: "manage-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/manage/addOrEidtProducts"),
        meta: {
          title: "发布新品"
        }
      },
      {
        path: "/products/manage/edit",
        name: "manage-edit",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/manage/addOrEidtProducts"),
        meta: {
          title: "编辑商品"
        }
      },
      {
        path: "/products/manage/copy",
        name: "manage-copy",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/manage/addOrEidtProducts"),
        meta: {
          title: "复制商品"
        }
      },
      {
        path: "/products/manage/re-applay",
        name: "manage-re-applay",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/manage/addOrEidtProducts"),
        meta: {
          title: "重新申请"
        }
      },
      {
        path: "/products/mall-config",
        name: "mall-config",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/mall-config"),
        meta: {
          title: "商城配置"
        }
      },
      {
        path: "/products/waiting-model",
        name: "waiting-model",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/waiting-model"),
        meta: {
          title: "等待建模"
        }
      },
      {
        path: "/stencil/fittings",
        name: "stencil-fittings",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/fittings/index")
      },
      {
        path: "/stencil/fittings/edit",
        name: "stencil-fittings-edit",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/fittings/update/index"),
        meta: {
          title: "编辑配件备注模板"
        }
      },
      {
        path: "/stencil/fittings/add",
        name: "stencil-fittings-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/fittings/update/index"),
        meta: {
          title: "新增配件备注模板"
        }
      },
      {
        path: "/stencil/fittings/related",
        name: "stencil-fittings-related",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/fittings/related"),
        meta: {
          title: "添加关联商品"
        }
      },
      {
        path: "/stencil/warranty",
        name: "stencil-warranty",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/index")
      },
      {
        path: "/stencil/warranty/add",
        name: "stencil-warranty-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/update"),
        meta: {
          title: "新增商品质保模板"
        }
      },
      {
        path: "/stencil/warranty/edit",
        name: "stencil-warranty-edit",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/update"),
        meta: {
          title: "编辑商品质保模板"
        }
      },
      {
        path: "/stencil/warranty/view",
        name: "stencil-warranty-view",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/view"),
        meta: {
          title: "质保模板详情"
        }
      },
      {
        path: "/stencil/warranty/goodsList",
        name: "stencil-warranty-goodsList",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/goodsList"),
        meta: {
          title: "关联商品列表"
        }
      },
      {
        path: "/stencil/warranty/related",
        name: "stencil-warranty-related",
        component: () => import(/* webpackChunkName: "home" */ "@/views/stencil/warranty/related"),
        meta: {
          title: "添加关联商品"
        }
      },
      {
        path: "/products/attribute",
        name: "products-attribute",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/attribute"),
        meta: {
          title: "品类属性"
        }
      },
      {
        path: "/products/specification",
        name: "products-specification",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/specification"),
        meta: {
          title: "商品规格"
        }
      },
      {
        path: "/oder",
        name: "oder",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/productOrders/index.vue"),
        meta: {
          title: "订单管理"
        }
      },
      {
        path: "/oder/add",
        name: "oder-add",
        component: () => import("@/views/oder/addProject/index.vue")
      },
      {
        path: "/oder/detail",
        name: "oder-detail",
        component: () => import("@/views/oder/oderDetail/index.vue"),
        meta: {
          title: "商品订单详情"
        }
      },
      {
        path: "/oder/stock-locking",
        name: "oder-stock-locking",
        component: () => import("@/views/oder/stockLocking/index.vue"),
        meta: {
          title: "库存锁定"
        }
      },
      {
        path: "/oder/procure",
        name: "purchase-Order",
        component: () => import("@/views/oder/purchaseOrder/index.vue")
      },
      {
        path: "/products/classify",
        name: "products-classify",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/classify"),
        meta: {
          title: "商品规格"
        }
      },
      // 订单发起采购相关路由---------------
      {
        path: "/purchase-immediately",
        name: "purchase-immediately",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/purchaseImmediately/index.vue"),
        meta: {
          title: "立即采购"
        }
      },
      {
        path: "/regular-time-procure",
        name: "regular-time-procure",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/regularTimeProcure/index.vue"),
        meta: {
          title: "定时采购"
        }
      },
      {
        path: "/measure-procure",
        name: "measure-procure",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/measureProcure/index.vue"),
        meta: {
          title: "测量采购"
        }
      },
      {
        path: "/edit-time-procure",
        name: "/edit-time-procure",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/editTimeProcure/index.vue"),
        meta: {
          title: "编辑定时采购"
        }
      },
      // ===================================测量预购单==========================
      {
        path: "/oder/measure",
        name: "oder-measure",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/measure/index.vue"),
        meta: {
          title: "测量预购单"
        }
      },
      {
        path: "/oder/measure/detail",
        name: "oder-measure-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/oder/measure/detail.vue"),
        meta: {
          title: "测量预购单详情"
        }
      },
      // ===================================采购管理==========================
      {
        path: "/procure/purchase-order",
        name: "procure-purchase-order",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/index.vue"),
        meta: {
          title: "采购单"
        }
      },
      {
        path: "/procure/purchase-order/detail",
        name: "procure-purchase-order-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/detail/index.vue"),
        meta: {
          title: "采购单详情"
        }
      },
      {
        path: "/procure/purchase-order/laundry",
        name: "procure-purchase-order-laundry",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/laundryList/index.vue"),
        meta: {
          title: "采购单清单"
        }
      },
      {
        path: "/procure/purchase-order/refuse-order",
        name: "procure-purchase-order-refuse-order",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/detail/refuseOder/index.vue"),
        meta: {
          title: "编辑采购订单"
        }
      },
      {
        path: "/procure/purchase-order/close-refuse-oder",
        name: "procure-purchase-order-close-refuse-oder",
        component: () =>
          import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/detail/closeRefuseOder/index.vue"),
        meta: {
          title: "采购单详情"
        }
      },
      {
        path: "/procure/purchase-order/merchant-add",
        name: "procure-purchase-order-merchant-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/products/purchase-order/components/selectProducts"),
        meta: {
          title: "选择采购单商品"
        }
      },
      {
        path: "/procure/entry",
        name: "procure-entry",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry"),
        meta: {
          title: "入库单"
        }
      },
      {
        path: "/procure/entry/add",
        name: "procure-entry-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry/add"),
        meta: {
          title: "新建入库单"
        }
      },
      {
        path: "/procure/entry/detail",
        name: "procure-entry-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry/detail"),
        meta: {
          title: "入库单详情"
        }
      },
      {
        path: "/procure/entry/put",
        name: "procure-entry-put",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry/put"),
        meta: {
          title: "入库"
        }
      },
      {
        path: "/procure/entry/list",
        name: "procure-entry-list",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry/list"),
        meta: {
          title: "入库清单"
        }
      },
      {
        path: "/procure/entry/select-prod",
        name: "procure-entry-select-prod",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry/components/selectProducts"),
        meta: {
          title: "选择商品"
        }
      },
      {
        path: "/procure/purchase-order",
        name: "purchase-order",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/entry"),
        meta: {
          title: "入库单"
        }
      },
      // ===================================仓库管理============
      {
        path: "/procure/warehouse",
        name: "procure-warehouse",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/warehouse"),
        meta: {
          title: "仓库管理"
        }
      },
      // ======================================出库单====================
      {
        path: "/procure/outbound",
        name: "procure-outbound",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound"),
        meta: {
          title: "出库单"
        }
      },
      {
        path: "/procure/outbound/add",
        name: "procure-outbound-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound/add"),
        meta: {
          title: "创建其他出库单"
        }
      },
      {
        path: "/procure/outbound/select-prod",
        name: "procure-outbound-select-prod",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound/components/selectProducts"),
        meta: {
          title: "选择商品"
        }
      },
      {
        path: "/procure/outbound/detail",
        name: "procure-outbound-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound/detail"),
        meta: {
          title: "出库单详情"
        }
      },
      {
        path: "/procure/outbound/list",
        name: "procure-outbound-list",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound/list"),
        meta: {
          title: "出库清单"
        }
      },
      {
        path: "/procure/outbound/put",
        name: "procure-outbound-put",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/outbound/put"),
        meta: {
          title: "出库"
        }
      },
      // ======================================订单出库====================
      {
        path: "/procure/indent-outbound",
        name: "procure-indent-outbound",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/indent-outbound"),
        meta: {
          title: "订单出库"
        }
      },
      {
        path: "/procure/indent-outbound/put",
        name: "procure-indent-outbound-put",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/indent-outbound/put"),
        meta: {
          title: "创建出库单"
        }
      },
      // ======================================库存管理====================
      {
        path: "/procure/inventory-manage",
        name: "procure-inventory-manage",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-manage"),
        meta: {
          title: "库存管理"
        }
      },
      // ======================================库存流水====================
      {
        path: "/procure/inventory-turnover",
        name: "procure-inventory-turnover",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-turnover"),
        meta: {
          title: "库存流水"
        }
      },
      // ======================================库存调拨====================
      {
        path: "/procure/inventory-allot",
        name: "procure-inventory-allot",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-allot"),
        meta: {
          title: "库存调拨"
        }
      },
      {
        path: "/procure/inventory-allot/add",
        name: "procure-inventory-allot-add",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-allot/add"),
        meta: {
          title: "创建库存调拨单"
        }
      },
      {
        path: "/procure/inventory-allot/select-prod",
        name: "procure-inventory-allot-select-prod",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-allot/components/selectProducts"),
        meta: {
          title: "选择商品"
        }
      },
      {
        path: "/procure/inventory-allot/detail",
        name: "procure-inventory-allot-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-allot/detail"),
        meta: {
          title: "库存调拨详情"
        }
      },
      // ======================================库存盘点====================
      {
        path: "/procure/inventory-count",
        name: "procure-inventory-count",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count"),
        meta: {
          title: "库存盘点"
        }
      },
      {
        path: "/procure/inventory-count/add-all",
        name: "procure-inventory-countadd-all",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/add-all"),
        meta: {
          title: "整仓盘点"
        }
      },
      {
        path: "/procure/inventory-count/add-sku",
        name: "procure-inventory-countadd-sku",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/add-sku"),
        meta: {
          title: "SKU盘点"
        }
      },
      {
        path: "/procure/inventory-count/select-prod",
        name: "procure-inventory-select-prod",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/components/selectProducts"),
        meta: {
          title: "选择SKU商品"
        }
      },
      {
        path: "/procure/inventory-count/enter",
        name: "procure-inventory-enter",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/enter"),
        meta: {
          title: "录入"
        }
      },
      {
        path: "/procure/inventory-count/detail",
        name: "procure-inventory-count-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/detail"),
        meta: {
          title: "库存盘点详情"
        }
      },
      {
        path: "/procure/inventory-count/inventory",
        name: "procure-inventory-count-inventory",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/inventory-count/inventory"),
        meta: {
          title: "库存盘点清单"
        }
      },
      {
        path: "/procure/profit",
        name: "procure-profit",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/profit"),
        meta: {
          title: "报盈报损"
        }
      },
      {
        path: "/procure/profit/detail",
        name: "procure-profit-detail",
        component: () => import(/* webpackChunkName: "home" */ "@/views/procure/profit/detail"),
        meta: {
          title: "报盈报损详情"
        }
      },
      // 定额模板管理-----------------------------------------------------------------
      {
        path: "/quota-template",
        name: "quotaTemplate",
        component: () => import("@/views/budgetQuotation/quotaTemplate/index.vue"),
        meta: {
          title: "定额模板管理"
        }
      },
      // 定额主材辅材页面
      {
        path: "/quota-main-materials",
        name: "quota-main-materials",
        component: () => import("@/views/budgetQuotation/components/quotaMainMaterials.vue"),
        meta: {
          title: "定额模板管理"
        }
      },
      // 预算报价
      {
        path: "/budget-management",
        name: "budget-management",
        component: () => import("@/views/budgetManagement/index.vue"),
        meta: {
          title: "预算报价管理"
        }
      },
      {
        path: "/quantity",
        name: "quantity",
        component: () => import("@/views/quantity/index.vue"),
        meta: {
          title: "工程量核量"
        }
      },
      {
        path: "/quantity/deatil",
        name: "quantity-deatil",
        component: () => import("@/views/quantity/detail/index.vue"),
        meta: {
          title: "核量详情"
        }
      },
      {
        path: "/quantityConfig",
        name: "quantityConfig",
        component: () => import("@/views/quantityConfig/index.vue"),
        meta: {
          title: "组件/核量基础设置"
        }
      },
      // 预算报价
      {
        path: "/fixed-selling-price",
        name: "fixed-selling-price",
        component: () => import("@/views/budgetManagement/fixedSellingPrice/index.vue"),
        meta: {
          title: "指定商品价格"
        }
      },
      {
        path: "/products/pricing",
        name: "pricing",
        component: () => import("@/views/products/pricing"),
        meta: {
          title: "商品定价"
        }
      },
      {
        path: "/products/pricing",
        name: "pricing",
        component: () => import("@/views/products/pricing"),
        meta: {
          title: "商品定价"
        }
      },
      {
        path: "/budget-package",
        name: "budget-package",
        component: () => import("@/views/budgetManagement/packagecombination/index.vue"),
        meta: {
          title: "预算套餐组合管理"
        }
      },
      {
        path: "/budgetpackageadd-default",
        name: "budgetpackageadd-default",
        component: () => import("@/views/budgetManagement/packagecombination/adddefaul/index.vue"),
        meta: {
          title: "预算套餐组合管理"
        }
      }
    ]
  }
];

const router = createRouter({
  history: createWebHistory(window.__MICRO_APP_BASE_ROUTE__ || "/"),
  routes
});

export default router;
